import 'item.dart';
import 'list_mock.dart';
import 'package:flutter/material.dart';

class ListIndex extends StatelessWidget {
  // const ListIndex({Key? key}) : super(key: key);
  List<Map<String,Object>>  _listItems =  listMockData.list(1,10);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      showSemanticsDebugger: false,
      home: Scaffold(
          appBar: AppBar(
            title: Text('A List App'),
          ),
          body:  ListView.builder(
            itemCount: _listItems.length,
            itemBuilder: (context, index) {
              return ListItem(
                title:_listItems[index]['title'],
                image:_listItems[index]['image'],
                viewCount:_listItems[index]['viewCount'],
              );
            })),
    );
  }
}
